import java.io.*;
import java.util.*;

public class Main {




    //拓扑排序
    static List<Integer> ans = new ArrayList<>();
    public static void main(String[] args) throws IOException {
       // Scanner in = new Scanner(System.in);
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
        String[] line = reader.readLine().split(" ");
        List<List<Integer>> graph = new ArrayList<>();
        int n= Integer.parseInt(reader.readLine());
        int m = Integer.parseInt(reader.readLine());
        int[] inDegree = new int[n];
        for (int i = 0; i < n; i++) {
            graph.add(new ArrayList<>());
        }
        for (int i = 0; i < m; i++) {
            line = reader.readLine().split(" ");
            int u = Integer.parseInt(line[0]);
            int v = Integer.parseInt(line[1]);
            inDegree[v-1]++;
            graph.get(u-1).add(v-1);
        }
        boolean flag = topologicalSort(graph,inDegree);
        if(flag){
            for (int i = 0; i < ans.size(); i++) {
                writer.write(String.valueOf(ans.get(i)));
                if (i!=n-1){
                    writer.write(" ");
                }
            }
        }else{
            writer.write("-1");
        }
        writer.flush();
        writer.close();
    }
    public static boolean topologicalSort(List<List<Integer>> graph,int[] inDegree){
        int num = 0;
        Deque<Integer> deque = new ArrayDeque<>();
        for (int i = 0; i < inDegree.length; i++) {
            if (inDegree[i] == 0) deque.offer(i);
        }
        while(!deque.isEmpty()){
            int u = deque.poll();
            ans.add(u+1);
            for (int i = 0; i < graph.get(u).size(); i++) {
                int v = graph.get(u).get(i);
                inDegree[v]--;
                if(inDegree[v] == 0)deque.offer(v);
            }
            graph.get(u).clear();
            num++;
        }
        return num == inDegree.length;
    }






    //分组
    public static int n,m;
    public static Map<Integer,Integer> hash = new HashMap<>();
    public static boolean check(int x){
        int g = 0;
        for (int a:hash.values()) {
            g+=a/x+(a%x == 0?0:1);
        }
        return g <=m;
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        int hmax = 0;
        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            hash.put(x,hash.getOrDefault(x,0)+1);
            hmax = Math.max(hmax,hash.get(x));
        }
        int kinds = hash.size();
        if(kinds>m) System.out.println(-1);
        else{
            int l =1,r = hmax;
            while(l<r){
                int mid = (l+r)/2;
                if(check(mid)){
                    r = mid;
                }else{
                    l = mid+1;
                }
            }
            System.out.println(l);
        }
    }









    //平方数
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        long x = in.nextLong();
        long a = (long)Math.sqrt(x);
        long x1 = a*a, x2 = (a+1)*(a+1);
        if(x-x1 <x2-x) System.out.println(x1);
        else System.out.println(x2);
    }








}
